package com.jack.a2021_09_29day03;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.jack.a2021_09_29day03.bean.Person;
import com.jack.a2021_09_29day03.di.BeanModule;
import com.jack.a2021_09_29day03.di.DaggerBeanComponent;

import javax.inject.Inject;

public class MainActivity extends AppCompatActivity {

    @Inject
    Person mPerson;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        DaggerBeanComponent.create().injectMainActivity(this);

        DaggerBeanComponent
                .builder()
                .beanModule(new BeanModule())
                .build()
                .injectMainActivity(this);

        System.out.println("mPerson " + (mPerson == null));
    }
}